import axios from '@/tool/axiso.js'
export const getGoodFn = (obj) => axios.get('goods', {
    params: obj
})
export const DeleteGoods = (id) => axios.delete(`goods/${id}`)
// 商品分类数据
export const getCat = (obj = {}) => axios.get('categories', {
    params: obj
})
// 添加分类
export const addcategories = (obj) => axios.post('categories', obj)
// 删除分类
export const deleteCarts = (id) => axios.delete(`categories/${id}`)
// 根据id查询参数
export const EditCarts = (id) => axios.get(`categories/${id}`)
// 确认修改
export const EditCartOK = (obj) => axios.put(`categories/${obj.id}`, obj)



// 参数列表
export const getCategories = (id, obj) => axios.get(`categories/${id}}/attributes`, {
    params: obj
})
// 编辑参数 点击input添加和点x删除参数
export const Editcategories = (id, attrId, obj) => axios.put(`categories/${id}/attributes/${attrId}`, obj)
// 添加参数
export const Addcategories = (id, obj) => axios.post(`categories/${id}/attributes`, obj)
// 根据id 查询参数
export const chaCategories=(id,attrId,obj)=>axios.get(`categories/${id}/attributes/${attrId}`,obj)

export const DelCategories=(id,attrId)=>axios.delete(`categories/${id}/attributes/${attrId}`)
